import java.util.Scanner;

public class demo01 {
    //另类加法
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()){
            int a=sc.nextInt();
            int b=sc.nextInt();
            int n=addAB(a,b);
            System.out.println(n);
        }
    }
    public static int addAB(int A, int B) {
        if(B==0){
            return A;
        }
        while (B!=0){
            int n1=A^B;
            int n2=(A&B)<<1;
            A=n1;
            B=n2;
        }
        return A;
    }
}
